Deprecate the gtk stock functions
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Thu, 27 Jun 2013 21:51:38 +0000 (17:51 -0400)
committerWilliam Jon McCann <william.jon.mccann@gmail.com>
Thu, 27 Jun 2013 21:51:38 +0000 (17:51 -0400)
gtk/gtkaction.c
gtk/gtkactiongroup.c
gtk/gtkdialog.c
gtk/gtkimagemenuitem.c
gtk/gtkinfobar.c
gtk/gtkstock.c
gtk/gtkstock.h
gtk/gtktoggletoolbutton.c
gtk/gtktoolbutton.c

index 71413bc117a652504386685bbb5e35c83a85a4a5..73f71a966510ac2a39614fedb1db21e17ca7ecc2 100644 (file)
@@ -1274,9 +1274,13 @@ gtk_action_set_label (GtkAction    *action,
   if (!action->private_data->label_set && action->private_data->stock_id)
     {
       GtkStockItem stock_item;
-      
+
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
       if (gtk_stock_lookup (action->private_data->stock_id, &stock_item))
        action->private_data->label = g_strdup (stock_item.label);
+
+      G_GNUC_END_IGNORE_DEPRECATIONS;
     }
 
   g_object_notify (G_OBJECT (action), "label");
@@ -1514,13 +1518,17 @@ gtk_action_set_stock_id (GtkAction   *action,
   if (!action->private_data->label_set)
     {
       GtkStockItem stock_item;
-      
+
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
       if (action->private_data->stock_id &&
          gtk_stock_lookup (action->private_data->stock_id, &stock_item))
        gtk_action_set_label (action, stock_item.label);
-      else 
+      else
        gtk_action_set_label (action, NULL);
-      
+
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+
       action->private_data->label_set = FALSE;
     }
 }
index 6121ca1cdcea8f9fb3ffc21b4ae819bf25ca3c21..9da45048a85b2bc8c1aa655f4c0db8effda9791f 100644 (file)
@@ -999,12 +999,16 @@ gtk_action_group_add_action_with_accel (GtkActionGroup *action_group,
 
       g_object_get (action, "stock-id", &stock_id, NULL);
 
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
       if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
         {
           accel_key = stock_item.keyval;
           accel_mods = stock_item.modifier;
        }
 
+      G_GNUC_END_IGNORE_DEPRECATIONS;
+
       g_free (stock_id);
     }
 
index 8aeb8dc040da6eac587f8a37f1366e796d3626eb..cd20b8d5510dbd29b68a5810f7165572b9e12d76 100644 (file)
@@ -744,6 +744,8 @@ gtk_dialog_add_button (GtkDialog   *dialog,
   button = gtk_button_new_with_label (button_text);
   gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
   if (button_text)
     {
       GtkStockItem item;
@@ -751,6 +753,8 @@ gtk_dialog_add_button (GtkDialog   *dialog,
         g_object_set (button, "use-stock", TRUE, NULL);
     }
 
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+
   gtk_widget_set_can_default (button, TRUE);
   gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
 
index 7ae442e747109ec1db37c21f6e05fbe1250e7308..d94298487dc514f8fd8cbaf17331611201fd90ed 100644 (file)
@@ -1002,6 +1002,8 @@ gtk_image_menu_item_set_accel_group (GtkImageMenuItem *image_menu_item,
 
   priv = image_menu_item->priv;
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
   if (priv->use_stock && priv->label && gtk_stock_lookup (priv->label, &stock_item))
     if (stock_item.keyval)
       {
@@ -1014,6 +1016,9 @@ gtk_image_menu_item_set_accel_group (GtkImageMenuItem *image_menu_item,
 
         g_object_notify (G_OBJECT (image_menu_item), "accel-group");
       }
+
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+
 }
 
 /**
index b550c23035de21e7edbb03ef568824963b1ee196..15d71ce5619f8e2171e23779a79ed4649fb1970c 100644 (file)
@@ -704,6 +704,8 @@ gtk_info_bar_add_button (GtkInfoBar  *info_bar,
   button = gtk_button_new_with_label (button_text);
   gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
   if (button_text)
     {
       GtkStockItem item;
@@ -711,6 +713,8 @@ gtk_info_bar_add_button (GtkInfoBar  *info_bar,
         g_object_set (button, "use-stock", TRUE, NULL);
     }
 
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+
   gtk_widget_set_can_default (button, TRUE);
 
   gtk_widget_show (button);
index 7f5155fea0a3e95986de88911231e0132cf3c263..c6bb3dc60936faf62ad7e2914f9bbe9087f9b4c7 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "config.h"
 
+#define GDK_DISABLE_DEPRECATION_WARNINGS
+
 #include <string.h>
 
 #include "gtkprivate.h"
@@ -142,7 +144,8 @@ real_add (const GtkStockItem *items,
  * any pointer into @items and @items can be freed. Use
  * gtk_stock_add_static() if @items is persistent and GTK+ need not
  * copy the array.
- * 
+ *
+ * Deprecated: 3.10
  **/
 void
 gtk_stock_add (const GtkStockItem *items,
@@ -160,7 +163,8 @@ gtk_stock_add (const GtkStockItem *items,
  *
  * Same as gtk_stock_add(), but doesn't copy @items, so
  * @items must persist until application exit.
- * 
+ *
+ * Deprecated: 3.10
  **/
 void
 gtk_stock_add_static (const GtkStockItem *items,
@@ -175,12 +179,13 @@ gtk_stock_add_static (const GtkStockItem *items,
  * gtk_stock_lookup:
  * @stock_id: a stock item name
  * @item: (out): stock item to initialize with values
- * 
+ *
  * Fills @item with the registered values for @stock_id, returning %TRUE
  * if @stock_id was known.
- * 
- * 
+ *
  * Return value: %TRUE if @item was initialized
+ *
+ * Deprecated: 3.10
  **/
 gboolean
 gtk_stock_lookup (const gchar  *stock_id,
@@ -227,6 +232,8 @@ gtk_stock_lookup (const gchar  *stock_id,
  * and each string in the list must be freed with g_free().
  *
  * Return value: (element-type utf8) (transfer full): a list of known stock IDs
+ *
+ * Deprecated: 3.10
  **/
 GSList*
 gtk_stock_list_ids (void)
@@ -277,6 +284,8 @@ gtk_stock_list_ids (void)
  * Copies a stock item, mostly useful for language bindings and not in applications.
  * 
  * Return value: a new #GtkStockItem
+ *
+ * Deprecated: 3.10
  **/
 GtkStockItem *
 gtk_stock_item_copy (const GtkStockItem *item)
@@ -303,7 +312,8 @@ gtk_stock_item_copy (const GtkStockItem *item)
  * Frees a stock item allocated on the heap, such as one returned by
  * gtk_stock_item_copy(). Also frees the fields inside the stock item,
  * if they are not %NULL.
- * 
+ *
+ * Deprecated: 3.10
  **/
 void
 gtk_stock_item_free (GtkStockItem *item)
@@ -496,6 +506,8 @@ static const GtkStockItem builtin_items [] =
  * ]|
  * 
  * Since: 2.8
+ *
+ * Deprecated: 3.10
  */
 void
 gtk_stock_set_translate_func (const gchar      *domain,
index 6cb46284437c7cff2f81c66b7d56d9645eee57ea..9547f8963c28a3229b339185f30689d949ecb9b4 100644 (file)
@@ -44,6 +44,8 @@ G_BEGIN_DECLS
  * and #GtkActionGroup.
  *
  * Returns: the translated message
+ *
+ * Deprecated: 3.10
  */
 typedef gchar * (*GtkTranslateFunc) (const gchar  *path,
                                      gpointer      func_data);
@@ -59,28 +61,28 @@ struct _GtkStockItem
   gchar *translation_domain;
 };
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
 void     gtk_stock_add        (const GtkStockItem  *items,
                                guint                n_items);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
 void     gtk_stock_add_static (const GtkStockItem  *items,
                                guint                n_items);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
 gboolean gtk_stock_lookup     (const gchar         *stock_id,
                                GtkStockItem        *item);
 
 /* Should free the list (and free each string in it also).
  * This function is only useful for GUI builders and such.
  */
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
 GSList*  gtk_stock_list_ids  (void);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
 GtkStockItem *gtk_stock_item_copy (const GtkStockItem *item);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
 void          gtk_stock_item_free (GtkStockItem       *item);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
 void          gtk_stock_set_translate_func (const gchar      *domain,
                                            GtkTranslateFunc  func,
                                            gpointer          data,
index 8b2f0848674f4e18afb8cb9d1c02fb4f5a1c41d0..7dd756aa4617231a5a36fa7514e08867fe0642c6 100644 (file)
@@ -224,7 +224,6 @@ gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *item)
   label_text = gtk_tool_button_get_label (tool_button);
   G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   stock_id = gtk_tool_button_get_stock_id (tool_button);
-  G_GNUC_END_IGNORE_DEPRECATIONS;
 
   if (GTK_IS_LABEL (label_widget))
     {
@@ -244,7 +243,9 @@ gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *item)
     {
       label = "";
     }
-  
+
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+
   if (use_mnemonic)
     menu_item = gtk_check_menu_item_new_with_mnemonic (label);
   else
index 126c8e6390395f4e12e2effeb8dd9f4aefbffd6e..7999ef82f3f2574c948d74666fdfa12965d55e5c 100644 (file)
@@ -447,6 +447,8 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
          gboolean elide;
          gchar *label_text;
 
+          G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
          if (button->priv->label_text)
            {
              label_text = button->priv->label_text;
@@ -463,6 +465,8 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
              elide = FALSE;
            }
 
+          G_GNUC_END_IGNORE_DEPRECATIONS;
+
          if (elide)
            label_text = _gtk_toolbar_elide_underscores (label_text);
          else
@@ -837,7 +841,9 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
 
   if (_gtk_tool_item_create_menu_proxy (item))
     return TRUE;
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
   if (GTK_IS_LABEL (button->priv->label_widget))
     {
       label = gtk_label_get_label (GTK_LABEL (button->priv->label_widget));
@@ -856,7 +862,9 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
     {
       label = "";
     }
-  
+
+  G_GNUC_END_IGNORE_DEPRECATIONS;
+
   if (use_mnemonic)
     menu_item = gtk_image_menu_item_new_with_mnemonic (label);
   else